import { apiGet, apiPost } from './api'

//获取公告列表
export const getNewslist = (query) => {
  return new Promise((resolve, reject) => {
    apiPost(
      'https://goods.zzgoodqc.cn/index.php/index/hao/getTowersList',
      query
    )
      .then((res) => {
        resolve(res)
      })
      .catch((err) => {
        reject(err)
      })
  })
}

//添加公告
export const addTableList = (query) => {
  return new Promise((resolve, reject) => {
    apiPost('https://goods.zzgoodqc.cn/index.php/index/hao/addTowers', query)
      .then((res) => {
        resolve(res)
      })
      .catch((err) => {
        reject(err)
      })
  })
}
//删除公告
export const delTableList = (query) => {
  return new Promise((resolve, reject) => {
    apiGet('https://goods.zzgoodqc.cn/index.php/index/hao/delTowers', query)
      .then((res) => {
        resolve(res)
      })
      .catch((err) => {
        reject(err)
      })
  })
}
//查看详情

export const newsInfo = (query) => {
  return new Promise((resolve, reject) => {
    apiPost(
      'https://goods.zzgoodqc.cn/index.php/index/hao/getTowersbyid',
      query
    )
      .then((res) => {
        resolve(res)
      })
      .catch((err) => {
        reject(err)
      })
  })
}
